home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
gnu
/
gdb
/
gdb_18s.zoo
/
expread.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-03-25
|
58KB
|
2,085 lines
/* A Bison parser, made from expread.y */
#define INT 258
#define CHAR 259
#define FLOAT 260
#define NAME 261
#define TYPENAME 262
#define STRING 263
#define STRUCT 264
#define UNION 265
#define ENUM 266
#define SIZEOF 267
#define UNSIGNED 268
#define COLONCOLON 269
#define LAST 270
#define REGNAME 271
#define VARIABLE 272
#define ASSIGN_MODIFY 273
#define ABOVE_COMMA 274
#define OR 275
#define AND 276
#define EQUAL 277
#define NOTEQUAL 278
#define LEQ 279
#define GEQ 280
#define LSH 281
#define RSH 282
#define UNARY 283
#define INCREMENT 284
#define DECREMENT 285
#define ARROW 286
#line 30 "expread.y"
#include "defs.h"
#include "param.h"
#include "symtab.h"
#include "frame.h"
#include "expression.h"
#include <stdio.h>
#ifdef atarist
extern int gcc_mshort;
#endif
extern CORE_ADDR end_of_text_addr;
static struct expression *expout;
static int expout_size;
static int expout_ptr;
static int yylex ();
static yyerror ();
static void write_exp_elt ();
static void write_exp_string ();
static void start_arglist ();
static int end_arglist ();
static void free_funcalls ();
static char *copy_name ();
/* If this is nonzero, this block is used as the lexical context
for symbol names. */
static struct block *expression_context_block;
/* Number of arguments seen so far in innermost function call. */
static int arglist_len;
/* Data structure for saving values of arglist_len
for function calls whose arguments contain other function calls. */
struct funcall
{
struct funcall *next;
int arglist_len;
};
struct funcall *funcall_chain;
/* This kind of datum is used to represent the name
of a symbol token. */
struct stoken
{
char *ptr;
int length;
};
#line 90 "expread.y"
typedef union
{
long lval;
double dval;
struct symbol *sym;
struct type *tval;
struct stoken sval;
int voidval;
struct block *bval;
enum exp_opcode opcode;
struct internalvar *ivar;
} YYSTYPE;
#ifndef YYLTYPE
typedef
struct yyltype
{
int timestamp;
int first_line;
int first_column;
int last_line;
int last_column;
char *text;
}
yyltype;
#define YYLTYPE yyltype
#endif
#include <stdio.h>
#ifndef __STDC__
#define const
#endif
#define YYFINAL 125
#define YYFLAG -32768
#define YYNTBASE 56
#define YYTRANSLATE(x) ((unsigned)(x) <= 286 ? yytranslate[x] : 66)
static const char yytranslate[] = { 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 48, 2, 2, 2, 40, 27, 2, 51,
52, 38, 36, 19, 37, 46, 39, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 55, 2, 30,
21, 31, 22, 41, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
47, 2, 50, 26, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 53, 25, 54, 49, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 1, 2, 3, 4, 5,
6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 20, 23, 24, 28, 29, 32, 33,
34, 35, 42, 43, 44, 45
};
static const short yyprhs[] = { 0,
0, 2, 4, 8, 11, 14, 17, 20, 23, 26,
29, 32, 35, 38, 42, 46, 51, 52, 58, 59,
61, 65, 70, 75, 79, 83, 87, 91, 95, 99,
103, 107, 111, 115, 119, 123, 127, 131, 135, 139,
143, 147, 151, 155, 161, 165, 169, 171, 173, 175,
177, 179, 181, 183, 188, 190, 192, 196, 200, 202,
204, 207, 209, 212, 215, 218, 221, 223
};
static const short yyrhs[] = { 57,
0, 58, 0, 57, 19, 58, 0, 38, 58, 0,
27, 58, 0, 37, 58, 0, 48, 58, 0, 49,
58, 0, 43, 58, 0, 44, 58, 0, 58, 43,
0, 58, 44, 0, 12, 58, 0, 58, 45, 65,
0, 58, 46, 65, 0, 58, 47, 57, 50, 0,
0, 58, 51, 59, 60, 52, 0, 0, 58, 0,
60, 19, 58, 0, 53, 63, 54, 58, 0, 51,
63, 52, 58, 0, 51, 57, 52, 0, 58, 41,
58, 0, 58, 38, 58, 0, 58, 39, 58, 0,
58, 40, 58, 0, 58, 36, 58, 0, 58, 37,
58, 0, 58, 34, 58, 0, 58, 35, 58, 0,
58, 28, 58, 0, 58, 29, 58, 0, 58, 32,
58, 0, 58, 33, 58, 0, 58, 30, 58, 0,
58, 31, 58, 0, 58, 27, 58, 0, 58, 26,
58, 0, 58, 25, 58, 0, 58, 24, 58, 0,
58, 23, 58, 0, 58, 22, 58, 55, 58, 0,
58, 21, 58, 0, 58, 18, 58, 0, 3, 0,
4, 0, 5, 0, 62, 0, 15, 0, 16, 0,
17, 0, 12, 51, 63, 52, 0, 8, 0, 65,
0, 61, 14, 65, 0, 61, 14, 65, 0, 6,
0, 64, 0, 63, 38, 0, 7, 0, 9, 65,
0, 10, 65, 0, 11, 65, 0, 13, 65, 0,
6, 0, 7, 0
};
#if YYDEBUG != 0
static const short yyrline[] = { 0,
151, 155, 156, 161, 164, 167, 171, 175, 179, 183,
187, 191, 195, 199, 205, 211, 215, 219, 225, 228,
232, 236, 242, 248, 254, 258, 262, 266, 270, 274,
278, 282, 286, 290, 294, 298, 302, 306, 310, 314,
318, 322, 326, 330, 334, 338, 344, 356, 363, 370,
373, 379, 385, 391, 398, 404, 423, 432, 443, 487,
488, 493, 496, 499, 502, 505, 509, 510
};
static const char * const yytname[] = { "$",
"error","$illegal.","INT","CHAR","FLOAT","NAME","TYPENAME","STRING","STRUCT","UNION",
"ENUM","SIZEOF","UNSIGNED","COLONCOLON","LAST","REGNAME","VARIABLE","ASSIGN_MODIFY","','","ABOVE_COMMA",
"'='","'?'","OR","AND","'|'","'^'","'&'","EQUAL","NOTEQUAL","'<'",
"'>'","LEQ","GEQ","LSH","RSH","'+'","'-'","'*'","'/'","'%'",
"'@'","UNARY","INCREMENT","DECREMENT","ARROW","'.'","'['","'!'","'~'","']'",
"'('","')'","'{'","'}'","':'","start","exp1","exp","@1","arglist",
"block","variable","type","typebase","name",""
};
#endif
static const short yyr1[] = { 0,
56, 57, 57, 58, 58, 58, 58, 58, 58, 58,
58, 58, 58, 58, 58, 58, 59, 58, 60, 60,
60, 58, 58, 58, 58, 58, 58, 58, 58, 58,
58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
58, 58, 58, 58, 58, 61, 61, 62, 62, 63,